//var jq=jQuery.noConflict();
$(function(){
    url = window.location.href;
    function do_video() {
        var _html = '<style>.add_wrap{border-bottom: 1px solid #e7e7eb; margin: 0 5px;}.add_wrap a{display: block; padding: 5px; border: 1px solid #e7e7eb; border-bottom: none; color: #222; text-decoration: none; font-size: 14px;} .add_wrap a:hover{color: #43b548;}'
        + '.my_vform{text-indent: 0; font-size: 14px;} .my_vform input{border: solid 1px #e7e7eb; padding: 8px 5px; line-height: 16px; height: 16px;}'
        + '.my_vform .f_item{display: block; margin-bottom: 10px;}'
        + '.my_vform fieldset{border: solid 1px #e7e7eb; margin-bottom: 10px;}.my_vform fieldset legend{color: #43b548}'
        + '.my_vform .f_item label{width: 85px; display: inline-block; text-align: right;}</style>'
		+ '<div class="my_video" style="border: 1px solid #e7e7eb; padding-bottom: 10px; margin: 0 10px 10px; background: #fff; position: fixed; bottom: 0; right: 0; line-height: 25px; width: 192px; z-index:99999999999999999; display: none;">'
        + '<div style="border-bottom: solid 1px #e7e7eb; position: relative;">'
        + '<p style="padding: 5px; font-weight: bold; font-size: 16px;">视频添加助手</p>'
        + '<a href="javascript:;" class="close" style="float: right;color: red;display: block;background: red;width: 16px;height: 16px;color: #fff;box-shadow: 5px;borde; line-height: 17px;text-align: center;font-size: 12px;text-decoration: none; position: absolute; right: -1px; top: -1px;">X</a>'
        + '</div>'
        + '<div class="add_wrap">'
		+ '<p style="padding: 10px 0;">选择需要使用的模式：</p>'
        + '<a href="javascript:;" class="add_video" flag="5">>> 四方图片引导</a>'
        + '<a href="javascript:;" class="add_video" flag="4">>> 文字链接引导</a>'
        + '<a href="javascript:;" class="add_video" flag="1">>> 角标引导</a>'
        + '<a href="javascript:;" class="add_video" flag="2">>> 常规高度压缩引导</a>'

        + '</div><div style="clear: both; padding: 5px 5px 0 0; margin-top: 5px;">'
        + '<p style="font-size: 10px;!important; float: right; margin-top: 5px;">powered by Rock</p>'
        + '</div>'
        + '</div>';
        $('body').append(_html);
        $('body').append('<span id="my_video_opener" class="btn btn_input btn_default" style="position: fixed; bottom: 20px; right: 10px; z-index:9999999999999999;"><button type="button" style="background: #e0eaf6; font-weight: bold;" >>>视频添加助手</button></span>')

        //弹出
        $('#my_video_opener').bind('click', function(){
            $(this).hide();
            $('.my_video').show();
        });
        //关闭
        $('.my_video .close').bind('click', function(){
            $('.my_video').hide();
            $('#my_video_opener').show();
        })

        $('.add_video').bind('click', function(){
            flag = $(this).attr('flag');
            title = $(this).text();
            html = null;
            callback = null;

            if (flag == 1 || flag == 2) {
                html = '<style>.my_vform .f_item input{width: 300px;}</style><div class="my_vform" style="width: 400px;">'
                + '<div class="f_item"><label>引导图地址：</label><input type="text" name="pic_url"/></div>'
                + '<div class="f_item"><label>引导图链接：</label><input type="text" name="pic_link"/></div>'
                + '<div class="f_item"><label>视频地址：</label><input type="text" name="video_url"/></div>'
                + '</div>';

                callback = function() {
                    var pic_url = $('.my_vform input[name="pic_url"]').val();
                    if (pic_url == '') {
                        alert('请填写引导图地址');
                        $('.my_vform input[name="pic_url"]').focus();
                        return false;
                    }

                    var pic_link = $('.my_vform input[name="pic_link"]').val();
                    if (pic_link == '') {
                        alert('请填写引导图链接');
                        $('.my_vform input[name="pic_link"]').focus();
                        return false;
                    }

                    var video_url = $('.my_vform input[name="video_url"]').val();
                    if (video_url == '') {
                        alert('请填写视频地址');
                        $('.my_vform input[name="video_url"]').focus();
                        return false;
                    }

                    data = {
                        pic_url: pic_url,
                        pic_link: pic_link,
                        video_url: video_url
                    }

                    insert_html(flag, data);
                }
            } else if (flag == 5) {
                html = '<style>.my_vform .f_item input{width: 245px;}</style><div class="my_vform" style="width: 350px;">'
                + '<fieldset><legend>>顶部引导图（留空则不显示）</legend>'
                + '<div class="f_item"><label>图片地址：</label><input type="text" name="pic_top_url"/></div>'
                + '<div class="f_item"><label>图片链接：</label><input type="text" name="pic_top_link"/></div>'
                + '</fieldset>'
                + '<fieldset><legend>>左侧引导图（留空则不显示）</legend>'
                + '<div class="f_item"><label>图片地址：</label><input type="text" name="pic_left_url"/></div>'
                + '<div class="f_item"><label>图片链接：</label><input type="text" name="pic_left_link"/></div>'
                + '</fieldset>' 
                + '<fieldset><legend>>右侧引导图（留空则不显示）</legend>'
                + '<div class="f_item"><label>图片地址：</label><input type="text" name="pic_right_url"/></div>'
                + '<div class="f_item"><label>图片链接：</label><input type="text" name="pic_right_link"/></div>'
                + '</fieldset>'
                + '<fieldset><legend>>底部引导图（留空则不显示）</legend>'
                + '<div class="f_item"><label>图片地址：</label><input type="text" name="pic_bottom_url"/></div>'
                + '<div class="f_item"><label>图片链接：</label><input type="text" name="pic_bottom_link"/></div>'
                + '</fieldset>'
                + '<div class="f_item"><label>视频地址：</label><input type="text" name="video_url" style="width: 337px;"/></div>'
                + '</div>';

                callback = function() {
                    var pic_top_url = $('.my_vform input[name="pic_top_url"]').val();
                    var pic_top_link = $('.my_vform input[name="pic_top_link"]').val();

                    var pic_left_url = $('.my_vform input[name="pic_left_url"]').val();
                    var pic_left_link = $('.my_vform input[name="pic_left_link"]').val();

                    var pic_right_url = $('.my_vform input[name="pic_right_url"]').val();
                    var pic_right_link = $('.my_vform input[name="pic_right_link"]').val();

                    var pic_bottom_url = $('.my_vform input[name="pic_bottom_url"]').val();
                    var pic_bottom_link = $('.my_vform input[name="pic_bottom_link"]').val();

                    var video_url = $('.my_vform input[name="video_url"]').val();
                    if (video_url == '') {
                        alert('请填写视频地址');
                        $('.my_vform input[name="video_url"]').focus();
                        return false;
                    }

                    data = {
                        pic_top_url: pic_top_url,
                        pic_top_link: pic_top_link,
                        pic_left_url: pic_left_url,
                        pic_left_link: pic_left_link,
                        pic_right_url: pic_right_url,
                        pic_right_link: pic_right_link,
                        pic_bottom_url: pic_bottom_url,
                        pic_bottom_link: pic_bottom_link,
                        video_url: video_url
                    }

                    insert_html(flag, data);
                }
            } else if (flag == 4) {
                html = '<style>.my_vform .fline label{width: 50px;}.f_item input{width: 295px;}.fline{display: inline-block!important; margin: 5px 0!important;}</style><div class="my_vform" style="width: 400px;">'
                + '<div class="f_item"><label style="width: 75px;">视频地址：</label><input type="text" name="video_url" style="width: 303px;"/></div>'
                + '<fieldset><legend><span style="background-color: rgb(255, 76, 0); color: rgb(62, 62, 62);">>底部文字1</span></legend>'
                + '<div class="f_item fline"><label>文字：</label><input type="text" name="txt_1" style="width: 50px;"/></div>'
                + '<div class="f_item fline"><label>链接：</label><input type="text" name="link_1" style="width: 220px;"/></div>'
                + '</fieldset>'
                + '<fieldset><legend><span style="color: rgb(87, 107, 149); background-color: rgb(253, 239, 176); ">>底部文字2</span></legend>'
                + '<div class="f_item fline"><label>文字：</label><input type="text" name="txt_2" style="width: 50px;"/></div>'
                + '<div class="f_item fline"><label>链接：</label><input type="text" name="link_2" style="width: 220px;"/></div>'
                + '</fieldset>'
                + '<fieldset><legend><span style="background-color: rgb(0, 209, 0); color: rgb(87, 107, 149);">>底部文字3</span></legend>'
                + '<div class="f_item fline"><label>文字：</label><input type="text" name="txt_3" style="width: 50px;"/></div>'
                + '<div class="f_item fline"><label>链接：</label><input type="text" name="link_3" style="width: 220px;"/></div>'
                + '</fieldset>'
                + '<fieldset><legend><span style="background-color: rgb(0, 252, 255); color: rgb(87, 107, 149);">>底部文字4</span></legend>'
                + '<div class="f_item fline"><label>文字：</label><input type="text" name="txt_4" style="width: 50px;"/></div>'
                + '<div class="f_item fline"><label>链接：</label><input type="text" name="link_4" style="width: 220px;"/></div>'
                + '</fieldset>'
                + '<fieldset><legend><span style="color: rgb(87, 107, 149);">>底部文字5</span></legend>'
                + '<div class="f_item fline"><label>文字：</label><input type="text" name="txt_5" style="width: 50px;"/></div>'
                + '<div class="f_item fline"><label>链接：</label><input type="text" name="link_5" style="width: 220px;"/></div>'
                + '</fieldset>'
                + '</div>';

                callback = function() {
                    var video_url = $('.my_vform input[name="video_url"]').val();
                    if (video_url == '') {
                        alert('请填写视频地址');
                        $('.my_vform input[name="video_url"]').focus();
                        return false;
                    }

                    data = {
                        video_url: video_url,
                        txt_1:$('.my_vform input[name="txt_1"]').val(),
                        link_1:$('.my_vform input[name="link_1"]').val(),
                        txt_2:$('.my_vform input[name="txt_2"]').val(),
                        link_2:$('.my_vform input[name="link_2"]').val(),
                        txt_3:$('.my_vform input[name="txt_3"]').val(),
                        link_3:$('.my_vform input[name="link_3"]').val(),
                        txt_4:$('.my_vform input[name="txt_4"]').val(),
                        link_4:$('.my_vform input[name="link_4"]').val(),
                        txt_5:$('.my_vform input[name="txt_5"]').val(),
                        link_5:$('.my_vform input[name="link_5"]').val(),
                    }

                    insert_html(flag, data);
                }
            }

            dialog_show(title,html, callback)
        })

        //提交处理
        function insert_html(flag, data){
            if (flag == 1) {
                var _video_frame = '<p><a href="' + data.pic_link + '"target="_blank"style="white-space: normal;"><img class="__bg_gif"data-ratio="0.16648291069459759"data-src="' + data.pic_url + '"data-type="gif"data-w="907"style="visibility: visible !important;width: auto !important;"width="auto"/></a></p><section data-role="outer"label="Powered by 135editor.com"style="font-family: 微软雅黑;font-size: 16px;"><section style="margin-top: 1em;margin-right: -20px;margin-bottom: -4em;font-size: 1em;font-weight: inherit;white-space: normal;width: 6em;height: 2em;line-height: 2em;text-decoration: inherit;color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);float: right;text-indent: 6px;transform: rotate(45deg);background-color: rgb(197, 63, 70);">点赞+转发</section><p style="max-width: 100%;min-height: 1em;white-space: normal;line-height: normal;text-align: center;box-sizing: border-box !important;word-wrap: break-word !important;background-color: rgb(255, 255, 255);"><iframe frameborder="0"scrolling="no"class="video_iframe"data-vidtype="-1"data-ratio="1.7647058823529411"data-w="480"data-src="' + data.video_url + '"></iframe></p><section class=""style="margin-top: -101em;margin-right: -3em;margin-bottom: -4em;font-size: 1em;font-weight: inherit;white-space: normal;width: 10em;height: 2em;line-height: 2em;text-align: center;text-decoration: inherit;color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);float: right;background-color: rgb(197, 63, 70);transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg);"></section></section>';

            } else if (flag == 2) {
                var _video_frame = '<p><a href="' + data.pic_link + '"target="_blank"style="white-space: normal;"><img class="__bg_gif"data-ratio="0.16648291069459759"data-src="' + data.pic_url + '"data-type="gif"data-w="907"style="visibility: visible !important;width: auto !important;"width="auto"/></a></p><p><iframe class="video_iframe"height="280"width="500"frameborder="0"data-src="' + data.video_url + '"src="' + data.video_url + '"allowfullscreen="allowfullscreen"scrolling="no"data-ratio="1.7647058823529411"></iframe></p><p style="line-height: 25.6px; white-space: normal;"><br/></p><p style="line-height: 25.6px; white-space: normal;"><br/></p><p style="line-height: 25.6px; white-space: normal;"><br/></p><p><br/></p><section style="margin-top: -188px; margin-left: 80px; line-height: 25.6px; white-space: normal; max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"></section><p><br/></p><fieldset style="white-space: normal; max-width: 100%; min-width: 0px; font-size: 15px; border-width: 1px 0px 0px; text-align: center; line-height: 22px; font-family: 宋体; border-top-color: rgb(168, 168, 167); border-top-style: dotted; background-color: rgb(255, 255, 255); box-sizing: border-box !important; word-wrap: break-word !important;"><legend style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><span style="max-width: 100%; font-size: 16px; box-sizing: border-box !important; word-wrap: break-word !important;"><span style="max-width: 100%; color: rgb(135, 206, 235); box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(0, 0, 0);"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;">关注我们</strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></span><span style="max-width: 100%; color: rgb(255, 255, 255); box-sizing: border-box !important; word-wrap: break-word !important; background-color: rgb(0, 0, 0);">查看更多视频</span></span>&nbsp;&nbsp;&nbsp;</legend></fieldset></div>';
            } else if (flag == 3) {
                _video_frame = '';

                if (data.pic_top_url != '') {
                    _video_frame += '<p><a href="' + data.pic_top_link + '"><img data-src="' + data.pic_top_url + '" class="" data-ratio="0.11296296296296296" data-w="540"/></a></p>';
                }
                _video_frame += '<section data-role="outer" label="Powered by 135editor.com" style="font-size: 16px;"><section style="margin-top: -6.5px;display: flex;justify-content: space-between;"><section style="width:80.1%;"><p><iframe frameborder="0" scrolling="no" class="video_iframe" data-vidtype="-1" data-ratio="1.7647058823529411" data-w="480" data-src="' + data.video_url + '"></iframe></p><p style="margin-top: -101em;margin-right: -3em;margin-bottom: -4em;font-size: 1em;font-weight: inherit;white-space: normal;width: 10em;height: 2em;line-height: 2em;text-align: center;text-decoration: inherit;color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);float: right;background-color: rgb(197, 63, 70);transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg);">更多精彩，请点击阅读原文！</p><p style="margin-top: -101em;margin-right: -3em;margin-bottom: -4em;font-size: 1em;font-weight: inherit;white-space: normal;width: 10em;height: 2em;line-height: 2em;text-decoration: inherit;color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);float: right;background-color: rgb(197, 63, 70);transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg);"><br  /></p></section><section style="width:19.65%;"><a href="' + data.pic_right_link + '" target="_blank"><img class="" data-ratio="2.296028880866426" data-type="gif" data-w="277" data-src="' + data.pic_right_url + '"  /></a></section></section></section>';

                if (data.pic_bottom_url != '') {
                    _video_frame += '<p><a href="' + data.pic_bottom_link + '"><img data-src="' + data.pic_bottom_url + '" class="" data-ratio="0.11940298507462686" data-w="670"/></a></p>';
                }
            } else if (flag == 4) {
                _video_frame = '<p><iframe class="video_iframe" data-vidtype="2" allowfullscreen="" frameborder="0" data-ratio="1.7666666666666666" data-w="848" scrolling="no" data-src="' + data.video_url + '" ></iframe>';

                if (data.txt_1 != '' && data.link_1 != '') {
                    _video_frame += '<a href="' + data.link_1 + '" style="outline: 0px;"><span style="background-color: rgb(255, 76, 0); color: rgb(62, 62, 62);">' + data.txt_1 + '</span></a><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
                }
                if (data.txt_2 != '' && data.link_2 != '') {
                    _video_frame += '<a href="' + data.link_2 + '" style="outline: 0px;"><span style="color: rgb(87, 107, 149); background-color: rgb(253, 239, 176);">' + data.txt_2 + '</span></a><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
                }
                if (data.txt_3 != '' && data.link_3 != '') {
                    _video_frame += '<a href="' + data.link_3 + '" style="outline: 0px;"><span style="background-color: rgb(0, 209, 0); color: rgb(87, 107, 149);">' + data.txt_3 + '</span></a><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
                }
                if (data.txt_4 != '' && data.link_4 != '') {
                    _video_frame += '<a href="' + data.link_4 + '" style="outline: 0px;"><span style="background-color: rgb(0, 252, 255); color: rgb(87, 107, 149);">' + data.txt_4 + '</span></a><span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
                }
                if (data.txt_5 != '' && data.link_5 != '') {
                    _video_frame += '<a href="' + data.link_5 + '" style="outline: 0px;"><span style="color: rgb(87, 107, 149);">' + data.txt_5 + '</span></a>';
                }

                _video_frame += '</p>';
            } else if (flag == 5) {
                _video_frame = '';

                if (data.pic_top_url != '') {
                    _video_frame += '<p><a href="' + data.pic_top_link + '"><img data-src="' + data.pic_top_url + '" class="" data-ratio="0.140625" data-w="640"/></a></p>';
                }

                _video_frame += '<section data-role="outer" label="Powered by 135editor.com" style="font-size: 16px;"><p style="margin-top: -101em;margin-right: -3em;margin-bottom: -4em;font-family: inherit;font-size: 1em;font-weight: inherit;width: 10em;height: 2em;line-height: 2em;text-align: center;text-decoration: inherit;color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);float: right;background-color: rgb(197, 63, 70);transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg);"><span style="font-family: 微软雅黑;">.</span></p><section style="margin-top: -8px;font-size: medium;display: flex;justify-content: center;">';

                width_l = '12.4101%';
                width_m = '75.1799%';
                width_r = '12.4101%';

                if (data.pic_left_url != '') {
                    _video_frame += '<section style="width: ' + width_l + ';text-align: right;">' +  (data.pic_left_link ? '<a href="' + data.pic_left_link + '">' : '') + '<img class="" data-copyright="0" data-cropselx1="0" data-cropselx2="69" data-cropsely1="0" data-cropsely2="235" data-ratio="3.4057971014492754" data-src="' + data.pic_left_url + '" data-type="gif" data-w="69" style="width: 69px;height: 235px;" />' +  (data.pic_left_link ? '</a>' : '') + '</section>';
                } else {
                    _video_frame += '<section style="width: ' + width_l + ';text-align: right;background: black;"></section>';
                }

                _video_frame += '<section style="margin-left: -1px;width: ' + width_m + ';"><p><iframe frameborder="0" scrolling="no" data-vidtype="-1" data-ratio="1.7647058823529411" data-w="480" class="video_iframe" data-src="' + data.video_url + '"></iframe></p></section>';

                if (data.pic_right_url != '') {
                    _video_frame += '<section style="width: ' + width_r + ';text-align: right;">' +  (data.pic_right_link ? '<a href="' + data.pic_right_link + '">' : '') + '<img class="" data-copyright="0" data-cropselx1="0" data-cropselx2="69" data-cropsely1="0" data-cropsely2="235" data-ratio="3.4057971014492754" data-src="' + data.pic_right_url + '" data-type="gif" data-w="69" style="width: 69px;height: 235px;" />' +  (data.pic_right_url ? '</a>' : '') + '</section>';
                } else {
                    _video_frame += '<section style="margin-left: -1px;width: ' + width_r + ';background: black;padding-top: 42.3%;height: 0;"></section>';
                }

                _video_frame += '</section></section>';

                if (data.pic_bottom_url != '') {
                    _video_frame += '<p><a href="' + data.pic_bottom_link + '"><img data-src="' + data.pic_bottom_url + '" class="" data-ratio="0.11940298507462686" data-w="670"/></a></p>';
                }

            }
            $(document.getElementById('ueditor_0').contentWindow.document.body).html(_video_frame);
        }

        setTimeout(function() {
            $('.faqscene').remove();
        }, 500);
        
    }

    function do_art(s) {
        var _html = '<style>ul li{list-style: none;}</style><fieldset class="my_art" style="border: dashed 1px blue; padding: 10px 0 10px 10px; margin: 0 10px 10px; background: #fff; position: fixed; bottom: 0; right: 0; line-height: 25px; width: 172px; z-index:99999999999999999;"><ul>'
        + '<li class="my_ext"></li>'
        + '<li>二维码：<br /><p id="qrcode"></p></li>'
        + '<li>封面图：<br /><img src="https://mmbiz.qlogo.cn/mmbiz/lOw25h5dn0soP3qBgA2gchxYFh7JhrreoDOBdvtBNbdM7ia4570ZJVzH7fMcMpk2ROS68Opiaic3JezBHUTcU9ZMg/0?wx_fmt=gif" style="width: 160px; height: 160px;" id="my_thumb"/></li>'
        + '</ul>'
        + '<div id="find_videos"><p>视频地址：</p></div>';

        _html += '<div style="clear: both; padding: 0 10px 0 0; margin-top: 5px; text-align: right; font-size: 10px;">'
        + 'powered by Rock'
        + '</div>'
        + '</fieldset>';
        $('body').append(_html);

        var img,_width=160,_height=160;
        $('.my_art #qrcode').qrcode({width:_width,height:_height,text:window.location.href});
        setTimeout(function() {
            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = "document.body.setAttribute('msg_cdn_url', msg_cdn_url);";
            document.head.appendChild(script);
            document.head.removeChild(script);
            document.getElementById('my_thumb').src=document.body.getAttribute('msg_cdn_url');

            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = "document.body.setAttribute('biz', biz);";
            document.head.appendChild(script);
            document.head.removeChild(script);

            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = "document.body.setAttribute('mid', mid);";
            document.head.appendChild(script);
            document.head.removeChild(script);

            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = "document.body.setAttribute('idx', idx);";
            document.head.appendChild(script);
            document.head.removeChild(script);

            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.innerHTML = "document.body.setAttribute('sn', sn);";
            document.head.appendChild(script);
            document.head.removeChild(script);


            var iframe = document.getElementsByTagName('iframe');
            var il=iframe.length;
            for (var i=0; i<il; i++) {
                var src = 'https://' + iframe[i].getAttribute('src');

                var vid = src.replace(/^.*?vid=(.*?)&.*$/g, "$1")
                var src = 'https://v.qq.com/iframe/preview.html?vid=' + vid + '&amp;width=500&amp;height=375&amp;auto=0;';

                var div = document.createElement('div');
                div.innerHTML = '<a href="' + src + '" target="_blank">>点击查看视频 [' + (i + 1) + ']</a>';
                document.getElementById('find_videos').appendChild(div);
            }

        }, 500);

        window.onscroll = function(){
            $('.gif_img_wrp').each(function(){
                img = $(this).find('img');
                img.attr('src', img.attr('data-src'));
                img.appendTo($(this).parent());
                $(this).remove();
            });
        }
    }

    function do_send() {
        //群发消息
            $("#list_container .weui-desktop-panel__title").append('&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="删除模式" class="my_do_del" />'); 

            $('.my_do_del').click(function(){
                $(this).val('已开启删除模式').css({color:'red'});

                $('.js_del .weui-desktop-opr-btn_primary').each(function(){
                    $(this).trigger('click');
                    obj = $(this).parent().parent().parent().parent().parent().parent().parent().parent();
                    time = $(obj).find('.weui-desktop-mass__time').text(); 
                    if(confirm('是否删除 [' + time + '] 的内容？')) {
                        $(this).addClass('needProcess').attr('data-del','1');
                    } else {
                        $(this).addClass('needProcess').attr('data-del','0');
                    }
                });
                //return false;
                
                var num = 0;
                time = setInterval(function(){
                    num += 1;
                    //console.log('-------------');
                    //console.log($('.needProcess').size());
                    //console.log(num);
                    
                    if($('.needProcess').size() > 0){
                        var obj = $('.needProcess').eq(0);
                        
                        if(obj.attr('data-del') == '1'){
             
                            obj.parent().parent().parent().find('.weui-desktop-popover__bar .weui-desktop-btn_primary').click();
                            obj.removeClass('needProcess');
                        }else{
                            obj.parent().find('.mpui-popover__bar .mpui-btn_default').click();
                            obj.removeClass('needProcess');
                        }
                    }else{
                        if(num>7){
                            alert('删除完毕！');
                            clearInterval(time); 
                        }
                    }
                },300);
            });
        //}
    }

    function do_alist() {
        $('.weui-desktop-page__title').append('<input type="button" value="删除模式" class="my_do_del2" style="margin-left: 50px;"/>');
        $('.my_do_del2').click(function(){
            $('.weui-desktop-appmsg').each(function(){
                del = $(this).find('.weui-desktop-appmsg__opr').find('.weui-desktop-tooltip__wrp:last .weui-desktop-icon-btn');
                del.append('<span>.</span>');
                del.find('span').trigger('click');
                $(this).find('.weui-desktop-card__ft').trigger('mouseover');

                time = $(this).find('.weui-desktop-appmsg__tips').text();
                if(confirm('是否删除 [' + time + '] 的内容？')) {
                    $('.weui-desktop-btn_primary').trigger('click');
                } else {
                    $('.weui-desktop-btn_default').trigger('click');
                }
            });
        })
    }

    function do_piclist() {
        $('.weui-desktop-form__label').append('<input type="button" value="选择全部" class="my_do_checkall" style="margin-left: 50px;"/>');
        $('.my_do_checkall').click(function(){
            $('.weui-desktop-form__check-label_img').each(function(){
                $(this).trigger('click');
            })
        })
    }

    function do_setup() {
        //http://mp.weixin.qq.com/s/0GqNwE0LoNH_EpA6KldypQ
        //http://mp.weixin.qq.com/s?__biz=MjM5OTE0OTEwMA==&tempkey=3tA1T9%2Bxzq6a0tb%2BpWdxztTh658TZKfnUUrAYcXnJJI4bl3XW3at1Kgm6xnDapp76Z6OEd5%2BhpWdTIWCQY8hs4FeK1QbrZA744KT5pR9fQjMBY%2BSI0%2BhUtsLkE4JR8MApYZuqSi4vPFPUyfRIC6Buw%3D%3D&chksm=3cd3a9cb0ba420dddc36974678250f1e8e774c096cb2b0947df5dd3c22543a6d2fa6004cce59#rd
        //http://mp.weixin.qq.com/s?__biz=MjM5ODMyMTk0MA==&mid=2660475386&idx=2&sn=db16a9b490eed274d53ad49c077d5cb5&chksm=bdab8b818adc0297d845acf622b5816dd6079c85ec59c28fc476fe24c29eedcc872094141411&scene=0#wechat_redirect
        //http://mp.weixin.qq.com/s?__biz=MjM5ODMyMTk0MA==&mid=2660475386&idx=1&sn=a823b85d96d87d5981216fc55c307a26&chksm=bdab8b818adc029786a28039ee67500832825412e921e0122fde08625fd41d4c159c1667aff2&scene=0#wechat_redirect
        //http://mp.weixin.qq.com/s?__biz=MjM5ODMyMTk0MA==&mid=2660475386&idx=1&sn=a823b85d96d87d5981216fc55c307a26&chksm=bdab8b818adc029786a28039ee67500832825412e921e0122fde08625fd41d4c159c1667aff2&scene=4#wechat_redirect
        
        art_page = /^http[s]?:\/\/mp\.weixin\.qq\.com\/s.*?$/i;
        //send_page = /^https:\/\/mp\.weixin\.qq\.com\/cgi-bin\/masssendpage\?t=mass\/list.*?$/i;
        send_page = /^https:\/\/mp\.weixin\.qq\.com\/cgi-bin\/home\?t=home\/index.*?$/i;
        edit_page = /^https:\/\/mp\.weixin\.qq\.com\/cgi-bin\/appmsg\?t=media\/appmsg_edit.*?$/i;
        
        art_list = /^https:\/\/mp\.weixin\.qq\.com\/cgi-bin\/appmsg.*?t=media\/appmsg_list.*?$/i;

        pic_list = /^https:\/\/mp\.weixin\.qq\.com\/cgi-bin\/filepage.*?type=2.*?$/i;

        if (r = url.match(art_page)) {
            do_art(r[1]);
        } else if (url.match(send_page)) {
            do_send();
        } else if (url.match(art_list)) {
            do_alist();
        } else if (url.match(pic_list)) {
            do_piclist();
        } else if (url.match(edit_page)) {
            $('body').append("<style>.txt-color-666{color:#666!important}.txt-textOneRow{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.txt-textTwoRow{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.cpt-dw-dialog-mask{position:fixed;width:100%;height:100%;top:0;left:0;bottom:0;right:0;-moz-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.cpt_mask_dialog{-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;position:fixed;top:0;left:0;width:100%;height:100%;font-family:'微软雅黑','Microsoft Yahei';z-index:1000002;animation-duration:.6s}.div_dialog{position:fixed;right: 10px; top:35px;min-width:240px;min-height:130px;-moz-box-shadow:0 3px 10px #aaa;-webkit-box-shadow:0 3px 10px #aaa;box-shadow:0 3px 10px #aaa}.div_dialog .close_dialog{position:absolute;height:40px;width:40px;right:-50px;top:-50px;cursor:pointer}.div_dialog .close_dialog .line1{position:absolute;top:50%;left:50%;width:30px;height:2px;background:#fff;margin:0 auto;-webkit-transform:translate(-50%,-50%) rotate(-45deg);transform:translate(-50%,-50%) rotate(-45deg)}.div_dialog .close_dialog .line2{position:absolute;top:50%;left:50%;width:30px;height:2px;background:#fff;margin:0 auto;-webkit-transform:translate(-50%,-50%) rotate(-45deg);transform:translate(-50%,-50%) rotate(45deg)}.div_dialog.no_boxShadow{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.div_dialog .title_dialog{cursor: move; font-size:20px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:10px 0;height:40px;position:relative;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.div_dialog .discription_dialog{padding:16px 0 14px 0;font-size:14px;text-indent:16px;line-height:1.5}.div_dialog .discription_dialog .dialog_input{height:28px;width:98%;margin:0 auto;outline:0;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #aaa}.div_dialog .discription_dialog .dialog_input::-webkit-input-placeholder{color:#a1a1a1}.div_dialog .discription_dialog .dialog_input:-moz-placeholder{color:#a1a1a1}.div_dialog .discription_dialog .dialog_input::-moz-placeholder{color:#a1a1a1}.div_dialog .discription_dialog .dialog_input:-ms-input-placeholder{color:#a1a1a1}.div_dialog .dialog_divOperation{display:-webkit-flex;display:flex;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;justify-content:flex-end;float:right;min-height:32px;line-height:32px}.div_dialog .dialog_divOperation.samewidth{width:100%}.div_dialog .dialog_divOperation.samewidth .btn_span{display:block;text-align:center;width:calc(50% - 10px);-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;line-height:1.5;-webkit-flex:1;flex:1}.div_dialog .dialog_divOperation.samewidth .btn_span.one_btn_span{margin:0!important;width:100%;float:none!important}.div_dialog .dialog_divOperation.samewidth .btn_span:first-child{margin-right:10px;float:left}.div_dialog .dialog_divOperation.samewidth .btn_span:last-child{margin-left:10px;float:right}.div_dialog .dialog_divOperation .btn_span{display:-webkit-flex;display:flex;@justify-content (center);-webkit-align-items:center;align-items:center;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;height:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:pointer;font-size:14px;line-height:18px;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none}.div_dialog .dialog_divOperation .btn_span:first-child{margin-right:10px}.div_dialog.primary .div_dialog{-moz-box-shadow:0 0 3px 0 #4D96DF;-webkit-box-shadow:0 0 3px 0 #4D96DF;box-shadow:0 0 3px 0 #4D96DF}.div_dialog.primary .div_dialog.no_boxShadow{-moz-box-shadow:0 0 0 0 #fff;-webkit-box-shadow:0 0 0 0 #fff;box-shadow:0 0 0 0 #fff}.div_dialog.primary .title_dialog{color:#4D96DF;border-bottom:1px dashed #4D96DF}.div_dialog.primary .discription_dialog{color:#313234}.div_dialog.primary .dialog_divOperation .btn_span{color:#fff;background:#4D96DF}.div_dialog.primary .dialog_divOperation .btn_span:hover{background:#4684C3}.div_dialog.primary .dialog_divOperation .btn_span.no_bg{background:#fff;color:#333}.div_dialog.primary .dialog_divOperation .btn_span.defalut{color:#fff;background:#4D96DF}.div_dialog.primary .dialog_divOperation .btn_span.reverse{color:#4D96DF;background:#fff;border:1px solid #4D96DF}.div_dialog.primary .dialog_divOperation .btn_span.reverse:hover{color:#4684C3;border:1px solid #4684C3}.div_dialog.success .div_dialog{-moz-box-shadow:0 0 3px 0 #21B384;-webkit-box-shadow:0 0 3px 0 #21B384;box-shadow:0 0 3px 0 #21B384}.div_dialog.success .div_dialog.no_boxShadow{-moz-box-shadow:0 0 0 0 #fff;-webkit-box-shadow:0 0 0 0 #fff;box-shadow:0 0 0 0 #fff}.div_dialog.success .title_dialog{color:#21B384;border-bottom:1px dashed #21B384}.div_dialog.success .discription_dialog{color:#283528}.div_dialog.success .dialog_divOperation .btn_span{color:#fff;background:#21B384}.div_dialog.success .dialog_divOperation .btn_span:hover{background:#28A47C}.div_dialog.success .dialog_divOperation .btn_span.no_bg{background:#fff;color:#333}.div_dialog.success .dialog_divOperation .btn_span.defalut{color:#fff;background:#21B384}.div_dialog.success .dialog_divOperation .btn_span.reverse{color:#21B384;background:#fff;border:1px solid #21B384}.div_dialog.success .dialog_divOperation .btn_span.reverse:hover{color:#28A47C;border:1px solid #28A47C}.div_dialog.danger .div_dialog{-moz-box-shadow:0 0 3px 0 #D9534F;-webkit-box-shadow:0 0 3px 0 #D9534F;box-shadow:0 0 3px 0 #D9534F}.div_dialog.danger .div_dialog.no_boxShadow{-moz-box-shadow:0 0 0 0 #fff;-webkit-box-shadow:0 0 0 0 #fff;box-shadow:0 0 0 0 #fff}.div_dialog.danger .title_dialog{color:#D9534F;border-bottom:1px dashed #D9534F}.div_dialog.danger .discription_dialog{color:#4F3536}.div_dialog.danger .dialog_divOperation .btn_span{color:#fff;background:#D9534F}.div_dialog.danger .dialog_divOperation .btn_span:hover{background:#C74743}.div_dialog.danger .dialog_divOperation .btn_span.no_bg{background:#fff;color:#333}.div_dialog.danger .dialog_divOperation .btn_span.defalut{color:#fff;background:#D9534F}.div_dialog.danger .dialog_divOperation .btn_span.reverse{color:#D9534F;background:#fff;border:1px solid #D9534F}.div_dialog.danger .dialog_divOperation .btn_span.reverse:hover{color:#C74743;border:1px solid #C74743}.div_dialog.warning .div_dialog{-moz-box-shadow:0 0 3px 0 #FFBD7A;-webkit-box-shadow:0 0 3px 0 #FFBD7A;box-shadow:0 0 3px 0 #FFBD7A}.div_dialog.warning .div_dialog.no_boxShadow{-moz-box-shadow:0 0 0 0 #fff;-webkit-box-shadow:0 0 0 0 #fff;box-shadow:0 0 0 0 #fff}.div_dialog.warning .title_dialog{color:#FFBD7A;border-bottom:1px dashed #FFBD7A}.div_dialog.warning .discription_dialog{color:#4F3536}.div_dialog.warning .dialog_divOperation .btn_span{color:#fff;background:#FFBD7A}.div_dialog.warning .dialog_divOperation .btn_span:hover{background:#F0AF6D}.div_dialog.warning .dialog_divOperation .btn_span.no_bg{background:#fff;color:#333}.div_dialog.warning .dialog_divOperation .btn_span.defalut{color:#fff;background:#FFBD7A}.div_dialog.warning .dialog_divOperation .btn_span.reverse{color:#FFBD7A;background:#fff;border:1px solid #FFBD7A}.div_dialog.warning .dialog_divOperation .btn_span.reverse:hover{color:#F0AF6D;border:1px solid #F0AF6D}</style>");
            do_video();
        }else{
            console.log(222);
        }
    }
    
    //初始化
    home_page = /^https:\/\/mp\.weixin\.qq\.com\/.*?$/i;
	if (home_page.test(url)) {
        do_setup();
    } 
    
    
    function getElementsByClassName(className,tagName){
        var ele=[],all=document.getElementsByTagName(tagName||"*");
        for(var i=0;i<all.length;i++){
            if(all[i].className==className){
                ele[ele.length]=all[i];
            }
        }
        return ele[0];
    }

    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
    }

    function dialog_show(title, html, callback) {
        $('body').dialog({
                type:'primary',
                width: 'auto',
                hideScroll: false,
                title: title,
                discription: html,
                buttons:[{name: '填入内容',className: 'defalut'},{name: '关闭',className: 'defalut'}],
            },
            function(ret) {
                if(ret.index===0){
                    if (callback() == false) 
                        return false;
                };
                if (ret.index===1) {
                    $('.div_dialog').remove();
                }
            }
        )
        $('.cpt-dw-dialog-mask').remove();
        $('body,html').css({"min-height":0,overflow:'auto'});
        $(document.body).css({'border-right':'none',});

        var $div = $(".div_dialog");
        $('.div_dialog .title_dialog').bind("mousedown", function(event){
            var offset_x = $div[0].offsetLeft;
            var offset_y = $div[0].offsetTop;
            var width_t = $div.width();
            var mouse_x = event.pageX;
            var mouse_y = event.pageY;
            $(document).bind("mousemove",function(ev){
                var _x = ev.pageX - mouse_x;
                var _y = ev.pageY - mouse_y;
                var width = $(window).width();
                var now_x = (width - offset_x - width_t - _x ) + "px";
                var now_y = (offset_y + _y ) + "px";
                $div.css({
                    top:now_y,
                    right:now_x
                });
            });
        });
            $(document).bind("mouseup",function(){
            $(this).unbind("mousemove");
        });
    }

})